<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
<script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
<script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>
<script src="/res/third/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/res/third/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script type="text/javascript"></script>
    <script type="text/html" id="mark_dialog">
        <div style="width: 400px;height: 150px;">
            <textarea id="auditOpinion2" name="auditOpinion" style="width: 100%;height: 100px;"></textarea>
        </div>
    </script>
</head>

<body>
	<div class="panel panel-info panel-content">
        <div class="panel-heading" style="position: relative;">

            <form id="soform" method="post">
                <table>
                    <tr>
                        <td class="w80" style="padding-top: 5px">
                            <label  class="center-block">合伙人申请</label>
                        </td>

                    </tr>
                </table>
            </form>
        </div>
		<table class="table table-hover table-bordered table-striped table-condensed">
				<tr>
					<th>序号</th>
					<th>类型</th>
                    <th>公司名称</th>
					<th>真实姓名</th>
					<th>手机</th>
                    <th>邮箱</th>
                    <th>省份</th>
                    <th>备注</th>
                    <th>创建时间</th>
                    <th>修改时间</th>
					<th>操作</th>
				</tr>
			[#list pagination.list as partner ]
			<tr>
				<td align="center">${partner_index+1}</td>
				<td align="center">[#if partner.type??][#if partner.type==1]城市合伙人[#else]平台合伙人[/#if][/#if]
                </td>
                <td align="center">${partner.companyName!}</td>
                <td align="center">${partner.realName!}</td>
                <td align="center">${partner.mobile!}</td>
                <td align="center">${partner.email!}</td>
                <td align="center">${partner.province!}</td>
                <td align="center">${partner.auditOpinion!}</td>
				<td align="center">${partner.createtime?string("yyyy-MM-dd")!}</td>
                <td align="center">${partner.updatetime?string("yyyy-MM-dd")!}</td>
				<td>
					<input type="button" class="btn-info" value="查看" onclick="findLook('${partner.id!}','${partner.type!}','${partner.companyName!}','${partner.realName!}','${partner.mobile!}','${partner.email!}','${partner.province!}','${partner.descr!}','${partner.auditOpinion!}','${partner.createtime?string("yyyy-MM-dd")!}','${partner.updatetime?string("yyyy-MM-dd")!}')">
					<input type="button" value="备注" onclick="updateByState('${partner.id!}')"  class="btn-info">
				</td>
			[/#list]
		</table>

        <div class="panel-footer">[@fenye p = pagination form = 'infoForm' /]</div>

	</div>



    <div id="create" style="width: 450px; height: 300px; display: none;">
        <form id="addform" method="post" class="form-horizontal" role="form">
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">类型</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="type" id="type">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">公司名称</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="companyName" id="companyName">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">真实姓名</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="realName" id="realName">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">手机</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="mobile" id="mobile">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">邮箱</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="email" id="email">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">省份</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="province" id="province">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">简单介绍</label>
                <div class="col-sm-7">
                    <textarea  class="col-sm-3 control-label" style="width: 100%"  name="descr" id="descr"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">处理意见</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="auditOpinion" id="auditOpinion">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">创建时间</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="createtime" id="createtime">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" id="clickforpro">修改时间</label>
                <div class="col-sm-7">
                    <input type="text" class="form-control" min="1" required="required" name="updatetime" id="updatetime">
                </div>
            </div>
        </form>
    </div>


	<script type="text/javascript">
	function findLook(id,type,companyName, realName,mobile,email,province,descr,auditOpinion,createtime,updatetime) {
        $("#id").val(id);
	    if(type==1){
            $("#type").val("城市合伙人");
        }else{
            $("#type").val("平台合伙人");
        }
        $("#companyName").val(companyName);
        $("#realName").val(realName);
        $("#mobile").val(mobile);
        $("#email").val(email);
        $("#province").val(province);
        $("#descr").val(descr);
        $("#auditOpinion").val(auditOpinion);
        $("#createtime").val(createtime);
        $("#updatetime").val(updatetime);
		art.dialog({
		    title:"合伙人申请内容",
            width:500,
			lock:true,
			content:document.getElementById("create")
		});
    }

    function updateByState(id) {
        art.dialog({
            title: "处理意见",
            width: 500,
            lock: true,
            content: $("#mark_dialog").html(),
            ok: function () {
                var auditOpinion = $("#auditOpinion2").val();
                $.ajax({
                    type:"post",
                    dataType:"json",
                    url:"/partner/addauditOpinion.do",
                    data:{id: id, auditOpinion: auditOpinion },
                    success:function(da){
                        if(da.success){
                            location.reload();//刷新页面
                            confirm(da.msg);
                        }
                    }
                });
            }
        });
    }
</script>
</body>
</html>